const state = {
  token: '',
  name: '',
  userName: '',
  surname: '',
  avatar: '',
  email: '',
  introduction: '',
  phoneNumber: '',
  roles: []
}

const mutations = {
  SET_TOKEN: (state, token) => {
    state.token = token
  }
}

const actions = {
  // user login
  // login({ commit }, userInfo) {
  //   const { username, password } = userInfo
  //   return new Promise((resolve, reject) => {
  //     clientSetting.username = username.trim()
  //     clientSetting.password = password
  //     login(clientSetting).then(response => {
  //       // const { data } = response
  //       commit('SET_TOKEN', response.access_token)
  //       setToken(response.access_token)
  //       resolve()
  //     }).catch(error => {
  //       reject(error)
  //     })
  //   })
  // }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
